package org.ichow.scenegame.controller 
{
	import org.ichow.scenegame.model.AssetsProxy;
	import org.ichow.scenegame.model.MovieProxy;
	import org.ichow.scenegame.view.SceneMediator;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author M.ichow
	 */
	public class MovieCommand extends SimpleCommand 
	{
		
		override public function execute(notification:INotification):void 
		{
			super.execute(notification);
			//
			var proxy:MovieProxy = facade.retrieveProxy(MovieProxy.NAME) as MovieProxy;
			var assets:AssetsProxy = facade.retrieveProxy(AssetsProxy.NAME) as AssetsProxy;
			var scene:SceneMediator = facade.retrieveMediator(SceneMediator.NAME) as SceneMediator;
			var type:String = notification.getBody() as String;
			var url:String = assets.getURL(type);
			if (url)
			{
				proxy.load(scene.getValueForKey("flashPath") + assets.getConfig("assetsPath") + url , 
							type , 
							{ width:scene.getValueForKey("width") , height: scene.getValueForKey("height") } );
			}
		}
	}

}